#include <stdio.h>
#include <string.h>

void mystrcat(char s1[], char s2[])
{
    strcpy(s1+strlen(s1), s2);
}

void mystrncat(char s1[], char s2[], int n)
{
    strncpy(s1+strlen(s1), s2, n);
}

int main(int argc, char const *argv[])
{
    char s1[10] = "abc";
    char s2[] = "xyz1234567890";

    mystrncat(s1, s2, sizeof(s1)-strlen(s1)-1);
    printf("s1: %s\n", s1);
    printf("s2: %s\n", s2);

    return 0;
}
